package org.starlight.user.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.*;
import org.starlight.user.entity.Dept;
import org.starlight.user.entity.Menu;
import org.starlight.user.serivce.MenuService;

/**
 * 菜单服务
 *
 * @author huangyong
 * @data 2025/2/28
 */
@Tag(name = "菜单服务", description = "菜单服务")
@RestController
@RequiredArgsConstructor
@RequestMapping("/menu")
public class MenuController {
    private final MenuService menuService;

    @Operation(summary = "保存部门")
    @ResponseStatus(HttpStatus.OK)
    @PostMapping
    public void save(Menu menu) {
        menuService.save(menu);
    }

    @Operation(summary = "删除部门")
    @ResponseStatus(HttpStatus.OK)
    @GetMapping("/{id}")
    public void del(@PathVariable Integer id) {
        menuService.del(id);
    }
}
